package com.blank.task19;

import java.io.Serializable;

public class User implements Serializable {

    private static final long serialVersionUID = 1629818809095592503L;
    //1、私有化成员变量
    private String name;  //用户名
    private String password;  //密码

    //2、构造方法
    //无参构造
    public User() {
    }
    //有参构造
    public User(String name,String password) {
        setName(name);
        setPassword(password);
    }
    //3、getter和setter

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    //4、打印输出toString

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
